import "./app.css";
import { useEffect } from "react";

function App() {
  useEffect(() => {
    window.addEventListener('mousemove', (ev) => {
      console.log(ev);
      if (ev.target === document.documentElement) {
        window.electron.ipcRenderer.send('ignore-mouse-events');
      } else {
        window.electron.ipcRenderer.send('noignore-mouse-events');
      }
    })
  }, []);

  function onMouseDown() {
    window.electron.ipcRenderer.send('move-start');
  }

  function onMouseUp() {
    window.electron.ipcRenderer.send('move-end');
  }
  

  return (
    <div onMouseDown={onMouseDown} onMouseUp={onMouseUp} className="puffy-button">80%</div>
  )
}

export default App

